//
// Created by changlei on 2022/4/1.
//

import Foundation
import UIKit


/// 电影列表
@objcMembers class Movie: NSObject, Viewable {
    var cover: String {
        get {
            coverUrl
        }
    }
    var coverRate: Double {
        get {
            4.0 / 3.0
        }
    }

    let rating: [String]
    let rank: Int
    let coverUrl: String
    let isPlayable: Bool
    let id: String
    let types: [String]
    let regions: [String]
    let title: String
    let url: String
    let releaseDate: String
    let actorCount: Int
    let voteCount: Int
    let score: String
    let actors: [String]
    let isWatched: Bool

    enum CodingKeys: String, CodingKey {
        case rating
        case rank
        case coverUrl = "cover_url"
        case isPlayable = "is_playable"
        case id
        case types
        case regions
        case title
        case url
        case releaseDate = "release_date"
        case actorCount = "actor_count"
        case voteCount = "vote_count"
        case score
        case actors
        case isWatched = "is_watched"
    }

    func copy(with zone: NSZone?) -> Any {
        self
    }
}